<?php
/**
 * +-------------------------------------------------------------
 * |Caption:
 * +-------------------------------------------------------------
 * |Author: Lenny
 * +-------------------------------------------------------------
 * |Email:  1685964109@qq.com
 * +-------------------------------------------------------------
 * |Date:   2024/6/17 下午6:19
 * +-------------------------------------------------------------
 */

use think\facade\Route;

// 登录
Route::group('login', function ()
{
    Route::post('', 'Login/login');
    Route::get('out', 'Login/out');
    Route::get('captcha', 'Login/captcha');
});

// 初始化
Route::group('init', function ()
{
    Route::get('', 'Init/index');
    Route::get('clear_cache', 'Init/clearCache');
});

// 用户管理
Route::group('user', function ()
{
    Route::get('list', 'User/list');
    Route::post('add', 'User/add');
    Route::post('edit', 'User/edit');
    Route::post('modify', 'User/modify');
    Route::post('del', 'User/del');
});

// 角色管理
Route::group('auth', function ()
{
    Route::get('list', 'Auth/list');
    Route::post('add', 'Auth/add');
    Route::post('edit', 'Auth/edit');
    Route::post('modify', 'Auth/modify');
    Route::post('del', 'Auth/del');
});

// 文件管理
Route::group('upload', function ()
{
    Route::get('list', 'Upload/list');
    Route::post('file', 'Upload/upload');
    Route::post('del', 'Upload/del');
});

// 日志管理
Route::group('log', function ()
{
    Route::get('list', 'Log/list');
});

// 集团管理
Route::group('group', function ()
{
    Route::get('list', 'Group/list');
    Route::post('add', 'Group/add');
    Route::post('edit', 'Group/edit');
    Route::post('modify', 'Group/modify');
    Route::post('del', 'Group/del');
});

// 企业管理
Route::group('company', function ()
{
    Route::get('list', 'Company/list');
    Route::post('add', 'Company/add');
    Route::post('edit', 'Company/edit');
    Route::post('modify', 'Company/modify');
    Route::post('del', 'Company/del');
});

// 检索列表
Route::group('search', function ()
{
    // 集团列表
    Route::get('group', 'Search/groupList');
    // 企业列表
    Route::get('company', 'Search/companyList');
    // 用户权限
    Route::get('auth', 'Search/authList');
    // 用户角色
    Route::get('role', 'Search/roleList');
    // 分类列表
    Route::get('cate', 'Search/cateList');
    // 品牌列表
    Route::get('brand', 'Search/brandList');
    // 单位列表
    Route::get('unit', 'Search/unitList');
});

// 菜单管理
Route::group('menu', function ()
{
    Route::get('list', 'Menu/list');
    Route::post('add', 'Menu/add');
    Route::post('edit', 'Menu/edit');
    Route::post('modify', 'Menu/modify');
    Route::post('del', 'Menu/del');
});
// 单位管理
Route::group('unit', function ()
{
    Route::get('list', 'Unit/list');
    Route::post('add', 'Unit/add');
    Route::post('edit', 'Unit/edit');
    Route::post('modify', 'Unit/modify');
    Route::post('del', 'Unit/del');
});

// 商品管理
Route::group('goods', function ()
{
    Route::get('list', 'Goods/list');
    Route::get('template', 'Goods/template');
    Route::get('export', 'Goods/export');
    Route::post('add', 'Goods/add');
    Route::post('edit', 'Goods/edit');
    Route::post('modify', 'Goods/modify');
    Route::post('del', 'Goods/del');
    Route::post('import','Goods/import');
});

// 品牌管理
Route::group('brand', function ()
{
    Route::get('list', 'Brand/list');
    Route::get('export', 'Brand/export');
    Route::post('add', 'Brand/add');
    Route::post('edit', 'Brand/edit');
    Route::post('modify', 'Brand/modify');
    Route::post('del', 'Brand/del');
});

// 分类管理
Route::group('category', function ()
{
    Route::get('list', 'Category/list');
    Route::get('export', 'Category/export');
    Route::post('add', 'Category/add');
    Route::post('edit', 'Category/edit');
    Route::post('modify', 'Category/modify');
    Route::post('del', 'Category/del');
});

// 仓库管理
Route::group('warehouse', function ()
{
    Route::get('list', 'Warehouse/list');
    Route::post('add', 'Warehouse/add');
    Route::post('edit', 'Warehouse/edit');
    Route::post('modify', 'Warehouse/modify');
    Route::post('del', 'Warehouse/del');
});

// 统计
Route::group('statistics', function ()
{
    // 销售
    Route::get('sale', 'Statistics/sale');
});

Route::group('board',function (){
    Route::get('index','Board/board');
    Route::get('sale_list','Board/saleList');
    Route::get('purchase_list','Board/purchaseList');
    Route::get('company_dealer','Board/companyDealer');
    Route::get('company_sale','Board/companySale');
    Route::get('warehouse','Board/warehouse');
});
